package com.huawang.mdesign.model.service.request;

import com.huawang.business.constants.ParamErrorConstants;
import com.huawang.mdesign.model.service.dto.propertymerge.PropertyMergePreviewVo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Collections;
import java.util.List;

/**
 * @auther lairenmao
 * @date 2025/4/16
 * 属性合并请求对象
 */
@Data
public class PropertyMergeDTO {
    @Schema(title = "项目id")
    @NotBlank(message = ParamErrorConstants.NO_PROJECT_ID)
    private String projectId;

    @Schema(title = "源模型id")
    @NotBlank(message = ParamErrorConstants.NO_SOURCE_INSTANCE_ID)
    private String sourceInstanceId;

    @Schema(title = "目标模型id")
    @NotBlank(message = ParamErrorConstants.NO_TARGET_INSTANCE_ID)
    private String targetInstanceId;

    @Schema(title = "单一属性合并规则，1-保留当前元素属性，2-使用目标元素属性替换")
    @NotNull(message = ParamErrorConstants.NO_SINGLE_PROPERTY_MERGE_RULE)
    private Integer singlePropertyMergeRule;

    @Schema(title = "拥有属性合并规则，1-类型和名称相同的属性合并，2-类型和名称相同的属性不合并")
    @NotNull(message = ParamErrorConstants.NO_OWNED_PROPERTY_MERGE_RULE)
    private Integer ownedPropertyMergeRule;

    @Schema(name = "合并后元素属性")
    private List<PropertyMergePreviewVo> propertyMergePreviewVos = Collections.emptyList();

}
